package com.zx._10_设计模式._0_综合案例.任务状态变更;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@Slf4j
public class Task {

    private Long taskId;

    // 任务的默认状态为初始化
    private State state = new TaskInit();

    // 任务进行了操作
    public void action(ActionType actionType) {
        state.updateState(this, actionType);
        log.info("Task action, action={}, task={}", actionType, this);
    }
}
